﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
using System.Runtime.InteropServices;
using System.Drawing.Drawing2D;

namespace selectpicture
{
    public partial class winners : Form
    {

        [DllImport("dwmapi.dll")]
        public static extern int DwmExtendFrameIntoClientArea(IntPtr hWnd, ref MARGINS pMarinset);
        [StructLayout(LayoutKind.Sequential)]
        public struct MARGINS
        {
            public int Right;
            public int left;
            public int Top;
            public int Bottom;
        }

        public winners(FileInfo[] e)
        {
            InitializeComponent();
            fl = e;
        }
        FileInfo[] fl;

        private void win_Load(object sender, EventArgs e)
        {
            this.BackgroundImage = null;
            MARGINS margins = new MARGINS();
            margins.left = -1;
            margins.Right = -1;
            margins.Top = -1;
            margins.Bottom = -1;
            IntPtr hwnd = Handle;
            int result = DwmExtendFrameIntoClientArea(hwnd, ref margins);

            this.BackColor = Color.Black;
            //要先修改label1的属性AutoSize为False
            this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
            this.label1.BackColor = Color.Transparent;
            this.label1.ForeColor = Color.White;
            this.label1.Font = new Font("微软雅黑", 15);
            this.label1.Text = "中奖名单" + "\n" + "\n";
            for (int i = 0; i < fl.Length; i++)//数组循环
            {
                string str = fl[i].ToString();
                string[] s = str.Split('.');//去掉扩展名
                label1.Text += s[0] + "\n";
            }
        }
       
    }
}
